//
//  HuSystemMacro.h
//  ProjectPublic
//
//  Created by ac hu on 2018/3/14.
//  Copyright © 2018年 ac hu. All rights reserved.
//

#ifndef HuSystemMacro_h
#define HuSystemMacro_h



//userDefault
#define UserDefaultSet(id,key) [[NSUserDefaults standardUserDefaults] setObject:id forKey:key];[[NSUserDefaults standardUserDefaults] synchronize]//存值
#define UserDefaultGet(key) [[NSUserDefaults standardUserDefaults]objectForKey:key]//取值

#define ArgumentToString(macro) #macro
#define ClangWarningConcat(warning_name) ArgumentToString(clang diagnostic ignored warning_name)
#define WarnDeprecatedStart _Pragma("clang diagnostic push") _Pragma(ClangWarningConcat("-Wdeprecated-declarations"))
#define WarnDeprecatedEnd _Pragma("clang diagnostic pop")

//手机型号
#define ISP4 (ScreenHeight == 480.0 ? YES : NO)
#define ISP6P (ScreenHeight == 736.0 ? YES : NO)
#define ISP5 (ScreenHeight == 568.0 ? YES : NO)
#define ISP6 (ScreenHeight == 667.0 ? YES : NO)
#define ISPX (ScreenHeight == 812.0f ? YES : NO)

//高于于ios7版本
#define iOS7_Greater ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)

//高于于ios7版本
#define iOS_Version [[[UIDevice currentDevice] systemVersion] floatValue]
//低于ios7版本
#define IOS7_Less   ( [[[UIDevice currentDevice] systemVersion] compare:@"7.0"] != NSOrderedAscending)
//系统语言
#define SysLanguage [NSString currentLanguage]
//系统语言是否为中文
#define SysLanguageIsChinese [NSString isChinese]

//图片
#define ImageUrlStr(STR) [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:STR]]]
#define ImageName(STR) [UIImage imageNamed:STR]

//弱引用self
#define WEAKSELF typeof(self) __weak weakSelf = self;

//网址
#define URL(urlStr) [NSURL URLWithString:urlStr]

//放大与旋转
#define Rotation(view,angle) view.transform=CGAffineTransformMakeRotation((float)angle * 180.0 / M_PI)//旋转
#define Scale(view,scale) view.transform =CGAffineTransformMakeScale((float)scale, (float)scale)//等比例放大
#define RotAndScale(view,scale,angle) view.transform=CGAffineTransformRotate(CGAffineTransformMakeScale((float)scale, (float)scale),(float)angle * 180.0 / M_PI )//放大加旋转

//获取系统版本
#define SystemVersionVersion [[[UIDevice currentDevice] systemVersion] floatValue]
#define CurrentSystemVersion [[UIDevice currentDevice] systemVersion]

//判断是否更新
#define App

//G－C－D
#define Gcd_Global(block) dispatch_async(dispatch_get_global_queue(0, 0), block)//串行异步
#define Gcd_Main(block) dispatch_async(dispatch_get_main_queue(),block)//回到主线程


//debug模式NSlog知道打印地址
#ifdef DEBUG
#define NSLog(FORMAT, ...) fprintf(stderr,"%s:%d  \t%s\n",[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
#else
#define NSLog(FORMAT, ...) nil
#endif

#endif /* HuSystemMacro_h */
